
<%@ page language="java" %>

<%@ page import="com.scalar.chiptrack.users.User,
                com.scalar.chiptrack.users.UserGroup,
                com.scalar.chiptrack.commons.SessionKeys,
                com.scalar.chiptrack.utils.ConfigManager,
				com.scalar.chiptrack.alarms.Alarm,
                com.scalar.chiptrack.alarms.dao.AlarmDAO,
				java.util.HashMap,
                java.util.ArrayList,
                java.util.Iterator"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/jsp/admin/admin.jsp"/>

<html:html><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR>

<script language='javascript'>
function removeAlarms() {
    document.alarmsWarningsForm.submit();
}
function cancelRemoveAlarms(){
	//document.alarmsWarningsForm.action.value = "cancel";
    //document.alarmsWarningsForm.submit(); 
	window.location="<%=chipTracContext%>/jsp/admin/admin.jsp";

}

function viewDetails(alarmId, alarmType)
{
    var tempURL = '<%=chipTracContext%>/alarmsWarnings.do?action=show&alarmId=' + alarmId + '&alarmType=' + alarmType
    newWindow = window.open (tempURL,'optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=400,resizable=yes');
    newWindow.focus();
}
</script>


</HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<!-- Top Header Start-->
<%@include file="/jsp/includes/header.jsp"  %>
<!-- Top Header End-->
  
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->
<%@ include file="/jsp/admin/admin_menu.jsp" %>
<!-- end of the side navigations -->
</TD>

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<!-- from here your body starts -->

<chiptrack:checkLogon sourcePage="/jsp/alarms_warnings.jsp"/>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>

<BR>
</TD>
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=100 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="80%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<html:form name='alarmsWarningsForm' type='com.scalar.chiptrack.ChipTrackActionForm' action='/alarmsWarnings.do?action=remove'>

<table align="left" border="0" width="85%">

    <tr><td>
        <center><span class="NArialW">Notifications and Warnings</span></center>
    </td></tr>

    <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=30></td></tr>
    <tr><td><chiptrack:info styleClass='NArialL'/></td></tr>
    <tr><td><chiptrack:errors styleClass='NArialL'/></td></tr>

    <%
        HashMap alarmMap = (HashMap)request.getAttribute("alarmMap");
        
        if ((alarmMap == null) || (alarmMap.isEmpty() == true)) {
		%>
            <tr><td align='center'><font class='NArialL'><font color='green'>No Notifications or Warnings are Selected for Deletion</font></td></tr>
		<%
        }
        else 
		{
            Iterator keys = alarmMap.keySet().iterator();
            String key = null;
            Alarm alarm = null;
            int index = 0;
			String bgColor[] = {"#DEE1E2", "#FFFFEE"};
		%>
        <tr><td align='center'><font class='NArialS'><font color='blue'></font></td></tr>
		<tr>
			<td ALIGN="left" bgcolor="#FFFFFF">
				<table border="0" width="100%" align=left>			
		<%
            while (keys.hasNext()) 
			{
                key = (String) keys.next();
                alarm = (Alarm) alarmMap.get (key);
		%>
                    <tr bgcolor='<%=bgColor[index%2]%>'>
						<td width='100%'><font class='NArialL'><%=alarm.getName()%></font>
							<input type="hidden" name="alarmIds" value="<%=alarm.getId()%>">
						</td>
                    </tr>
					
					
		<%		index++;
			}
		}%>

				<tr><td colspan='2'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
				<tr><td align='center' colspan='2'>
					<a href="javascript:removeAlarms()"><img border="0" onMouseOver="window.status='Click here to confirm';return true" src="<%=chipTracContext%>/jsp/includes/images/confirm.gif"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="javascript:cancelRemoveAlarms()"><img onMouseOver="window.status='Click here to cancel';return true"  border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></a>
				</td></tr>
			</table>
			</td>
		</tr>
        <tr><td><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=1></td></tr>
</table>

</html:form>

<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- till here -->

<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</html:html>